package com.hpin.mlxteacher.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hpin.mlxteacher.R;
import com.hpin.mlxteacher.bean.VerResTwoList;

import java.util.List;

/**
 * Created by Aaron on 15/8/21.
 */
public class ClassifyRightAdapter extends BaseAdapter {

    private Context ctx;
    private List<VerResTwoList> towList;

    public ClassifyRightAdapter(Context ctx, List<VerResTwoList> towList) {
        this.ctx = ctx;
        this.towList = towList;
    }

    public void setTowList(List<VerResTwoList> towList) {
        this.towList = towList;
    }

    @Override
    public int getCount() {
        return towList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {


        ViewHolder viewHolder=null;

        if (convertView == null) {

            convertView = View.inflate(ctx, R.layout.item_simple, null);
            viewHolder = new ViewHolder();
            viewHolder.tv_classify = (TextView) convertView.findViewById(R.id.tv_classify);
            convertView.setTag(viewHolder);

        }else{
            viewHolder=(ViewHolder) convertView.getTag();
        }

        viewHolder.tv_classify.setText(towList.get(position).typeName);

        return convertView;
    }

    private class ViewHolder {
        private TextView tv_classify;

    }
    
}
